﻿using System.Reflection;
using OnHook.Framework.Extensions;
using OnHook.Framework.Ioc;
using OnHook.Framework.Module;
using Microsoft.AspNetCore.Builder;

namespace OnHook.Framework
{
    public class CoreFrameModule : FrameModule
    {
        public override void PreInit(BootParams model)
        {
            model.Services.RegsiterAssembly(Assembly.GetExecutingAssembly());
            base.PreInit(model);
        }

        public override void PostInit(IApplicationBuilder app)
        {
            ServiceLocator.ServiceProvider = app.ApplicationServices;
        }
    }
}
